package edu.hunau.cxb19.oop.class12;

import org.junit.Test;

/**
 *
 * @author hb
 *
 *         2020-03-11 16:12:40
 */
public class StringBuilderTest {

	//@Test
	public void test() {
		StringBuilder sb = new StringBuilder("abc123");
		sb.append("4");
		System.out.println(sb);//abc1234
		sb.insert(0, "A");
		System.out.println(sb);//Aabc1234
		sb.deleteCharAt(1);
		System.out.println(sb);//Abc1234
		sb.reverse();//反转
		System.out.println(sb);//4321cbA
		
 	}
	
	@Test
	public void testAdd() {
		String a="";
		for (int i = 0; i < 100000; i++) {
			a+="A";
		}
		
	}
	@Test
	public void testAppend() {
		StringBuilder sb = new StringBuilder("");
		for (int i = 0; i < 100000; i++) {
			sb.append("A");
		}
	}

}
